package com.xkdx.guangguang.fragment.brand;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.xkdx.guangguang.module.network.AbsAction;
import com.xkdx.guangguang.module.statics.IConstants;

public class BrandInfoAction extends AbsAction {
	String brandID,cityID;
	
	public BrandInfoAction(String brandID,String cityID) {
		this.brandID=brandID;
		this.cityID=cityID;
	}
	@Override
	public void constructRequest() {
		// 品牌详情
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("DeviceID", "2");
		map.put("BrandID", brandID);
		String shopDetailJson = constructJson(map);
		Parameter parameter = new Parameter("brandInterface", "getBrandDetail", shopDetailJson);

		// 优惠信息
		HashMap<String, String> newInfomap = new HashMap<String, String>();
		newInfomap.put("DeviceID", "2");
		newInfomap.put("RegionID", cityID);
		newInfomap.put("BrandID", brandID);
		newInfomap.put("InfoType", "1|2");
		newInfomap.put("PageIndex", "1");
		newInfomap.put("PageSize", "30");
		newInfomap.put("RefreshTime", "1900-1-1");
		String newInfoJson = constructJson(newInfomap);
		Parameter newInfoparameter = new Parameter("informationInterface", "getInfoListByBrand", newInfoJson);
		// 品牌分店
		HashMap<String, String> partShopmap = new HashMap<String, String>();
		partShopmap.put("DeviceID", "2");
		partShopmap.put("RegionID", cityID);
		partShopmap.put("BrandID", brandID);
		partShopmap.put("Longitude", String.valueOf(IConstants.lon));
		partShopmap.put("Latitude", String.valueOf(IConstants.lat));
		partShopmap.put("PageSize", "100");
		partShopmap.put("PageIndex", "1");
		String partShopJson = constructJson(partShopmap);
		Parameter partShopParameter = new Parameter("shopInterface", "getShopListByBrand", partShopJson);
		// 评论
		HashMap<String, String> commentmap = new HashMap<String, String>();
		commentmap.put("DeviceID", "2");
		commentmap.put("BrandID", brandID);
		commentmap.put("PageIndex", "1");
		commentmap.put("PageSize", "10");
		commentmap.put("RefreshTime", IConstants.getCommentTime());
		String commentJson = constructJson(commentmap);
		Parameter commentParameter = new Parameter("commentInterface", "getCommentListByBrand", commentJson);

		List<Parameter> list = new ArrayList<AbsAction.Parameter>();
		list.add(parameter);
		list.add(partShopParameter);
		list.add(newInfoparameter);
		list.add(commentParameter);
		requestData = constructMod(list);
	}

}
